function message() {

    var phone = document.getElementById("account").value;
    var pass1 = document.getElementById("ps1").value;
    var pass2 = document.getElementById("ps2").value;
    var name = document.getElementById("name").value;
    var id = document.getElementById("idNumber").value;


    if (!(/^[1][3,4,5,6,7,8,9][0-9]{9}$/.test(phone))){
        layer.msg("请输入正确的手机号！", {
            icon: 2,
            time: 1000,
            offset:80,
            end: function () {
            }
        });
    }
    else if (pass1 != pass2) {
        layer.msg("两次密码不一致，请检查!", {
            icon: 2,
            time: 1000,
            offset:80,
            end: function () {
            }
        });
    }else if ((pass1.length<8)||!(/[A-Za-z].*[0-9]|[0-9].*[A-Za-z]/.test(pass1))){
        layer.msg("密码强度不够，请检查!", {
            icon: 2,
            time: 1000,
            offset:80,
            end: function () {
            }
        });
    }else if (name.length<1){
        layer.msg("姓名不能为空，请检查!", {
            icon: 2,
            time: 1000,
            offset:80,
            end: function () {
            }
        });
    }else if (!(/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(id))){
        layer.msg("无效的身份证号，请检查!", {
            icon: 2,
            time: 1000,
            offset:80,
            end: function () {
            }
        });
    }else {
        layer.msg("注册成功!", {
            icon: 1,
            time: 500,
            end: function () {
                var index = parent.layer.getFrameIndex(window.name);
                parent.layer.close(index);
                location.reload();//do something
            }
        });
    }
}



function tip1() {
    layer.tips('11位有效号码，用于登录账号', '#account');
    document.getElementById("account").setAttribute("placeholder","");

}
function set1() {
    document.getElementById("account").setAttribute("placeholder","请输入手机号码");
}

function tip2() {
    layer.tips('不少于8位，由字母和数字组成', '#ps1');
    document.getElementById("ps1").setAttribute("placeholder","");
}
function set2() {
    document.getElementById("ps1").setAttribute("placeholder","请输入密码");
}

function tip3() {
    layer.tips('两次密码保持一致', '#ps2');
    document.getElementById("ps2").setAttribute("placeholder","");
}
function set3() {
    document.getElementById("ps2").setAttribute("placeholder","请确认密码");
}

function tip4() {
    layer.tips('不能为空', '#name');
    document.getElementById("name").setAttribute("placeholder","");
}
function set4() {
    document.getElementById("name").setAttribute("placeholder","请输入姓名");
}

function tip5() {
    layer.tips('有效的身份证号', '#idNumber');
    document.getElementById("idNumber").setAttribute("placeholder","");
}
function set5() {
    document.getElementById("idNumber").setAttribute("placeholder","请输入身份证号");
}

